package tech.xs.test;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import tech.xs.entity.User;
import tech.xs.service.UserService;
import tech.xs.service.impl.UserServiceImpl2;

public class text {

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		//读取映射文件
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext2.xml");
		//获取映射文件中bean的ID
		UserService userService= (UserService) applicationContext.getBean("UserService");
		List<User>list=userService.getAllUser();
		for (User s : list) {
			System.out.println(s);
		}
		
		
		
	}

}
